﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo1
{
    class Class2
    {
        static void StringUtil()
        {
            Boolean D;
            Console.WriteLine("请输入字符串：");
            string n = Console.ReadLine();
            if (n == null)
            {
                D = true;
                Console.WriteLine("字符串是null");
            }
            if (n == "")
            {
                D = true;
                Console.WriteLine("字符串是空");
            }
            else {
                D = false;
                Console.WriteLine("错误");
            }
            foreach (char item in n)
            {

                if (item == ' ')
                {
                    D = true;
                    Console.WriteLine("字符串是N个空格");
                }
                else
                {
                    D = false;
                    Console.WriteLine("错误");
                    break;
                }
            }
        }
        static void ArrayUtil()
        {
            Boolean S;
            Console.WriteLine("请输入：");
            string m = Console.ReadLine();
            if (string.IsNullOrWhiteSpace(m))
            {
                S = true;
                Console.WriteLine("数组是null，或者数组长度为0");
            }
            else
            {
                S = false;
                Console.WriteLine("错误");
            }
        }
    }
}
